<?php
/**
* Admin for CMS settings
*
* @author Mario Schillermann <info@rockit-flash.com>
* @encoding UTF-8 äöüßÖÄÜ
* @copyright © 2011 Mario Schillermann (info@rockit-flash.com)
* @license GNU GPL v2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* @package Page
* @subpackage Index
* @link $HeadURL$
* @version SVN: $Id$
* @phpVersion >=5
* @todo
*/

class Admin_Form_Setup extends Zend_Form {
    /**
     * Index
     *
     * @return void
     */
    public function build()
    {
        //$this->setAction('/user/login')
        //     ->setMethod('post');

        // Ein username Element erstellen und konfigurieren:
        /*$username = $this->createElement('text', 'username');
        $username->addValidator('alnum')
             ->addValidator('regex', false, array('/^[a-z]+/'))
             ->addValidator('stringLength', false, array(6, 20))
             ->setRequired(true)
             ->addFilter('StringToLower');

        // Ein username Element erstellen und konfigurieren:
        $username = $this->createElement('text', 'username');
        $username->addValidator('alnum')
             ->addValidator('regex', false, array('/^[a-z]+/'))
             ->addValidator('stringLength', false, array(6, 20))
             ->setRequired(true)
             ->addFilter('StringToLower');

    // Ein Passwort Element erstellen und konfigurieren:
    $password = $this->createElement('password', 'password');
    $password->addValidator('StringLength', false, array(6))
             ->setRequired(true);

    // Elemente dem Formular hinzufügen:
    $this->addElement($username, 'test')
         ->addElement($password)
         // addElement() als Factory verwenden um den 'Login' Button zu erstellen:
         ->addElement('submit', 'login', array('label' => 'Login'));*/
        $this->addElement(new Zend_Form_Element_Text(
            'firstname', array('label' => 'Vorname')));
        $this->addElement(new Zend_Form_Element_Text(
            'lastname', array('label' => 'Nachname')));
        $this->addElement(new Zend_Form_Element_Text(
            'email', array('label' => 'E-Mail')));
        $this->addElement(new Zend_Form_Element_Text(
            'username', array('label' => 'Benutzername')));
        $this->addElement(new Zend_Form_Element_Password(
            'password', array('label' => 'Passwort')));
        $this->addElement(new Zend_Form_Element_Submit('send', 'speichern'));

        $this->username->addValidator('regex', false, array('/^[a-z]/i'));

        $this->addDisplayGroup(
            array(
                'firstname',
                'lastname',
                'email',
                'username',
                'password',
                'send'
            ),
            'groups',
            array("legend" => ""));

        return $this;

    }

}